<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.org/ui">

    <h:form id="IngresosListForm">

        <p:panel header="#{rentaBundle.ListIngresosTitle}">

            <p:dataTable id="datalist" value="#{ingresosController.items}" var="item"
                         selectionMode="single" selection="#{ingresosController.selected}"
                         rowKey="#{item.idingresos}"
                         paginator="true"
                         rows="10"
                         rowsPerPageTemplate="10,20,30"
                         >

                <p:ajax event="rowSelect"   update="createButton viewButton editButton deleteButton"/>
                <p:ajax event="rowUnselect" update="createButton viewButton editButton deleteButton"/>

                <p:column sortBy="#{item.idingresos}" filterBy="#{item.idingresos}">
                    <f:facet name="header">
                        <h:outputText value="#{rentaBundle.ListIngresosTitle_idingresos}"/>
                    </f:facet>
                    <h:outputText value="#{item.idingresos}"/>
                </p:column>
                <p:column sortBy="#{item.fechaingresos}" filterBy="#{item.fechaingresos}">
                    <f:facet name="header">
                        <h:outputText value="#{rentaBundle.ListIngresosTitle_fechaingresos}"/>
                    </f:facet>
                    <h:outputText value="#{item.fechaingresos}">
                        <f:convertDateTime pattern="MM/dd/yyyy HH:mm:ss" />
                    </h:outputText>
                </p:column>
                <p:column sortBy="#{item.montoingresos}" filterBy="#{item.montoingresos}">
                    <f:facet name="header">
                        <h:outputText value="#{rentaBundle.ListIngresosTitle_montoingresos}"/>
                    </f:facet>
                    <h:outputText value="#{item.montoingresos}"/>
                </p:column>
                <p:column sortBy="#{item.tipoingresosIdtipoingresos.nombretipoingresos}" filterBy="#{item.tipoingresosIdtipoingresos.nombretipoingresos}">
                    <f:facet name="header">
                        <h:outputText value="#{rentaBundle.ListIngresosTitle_tipoingresosIdtipoingresos}"/>
                    </f:facet>
                    <h:outputText value="#{item.tipoingresosIdtipoingresos.nombretipoingresos}"/>
                </p:column>
                <f:facet name="footer">
                    <div class="footer-section">
                        <p:commandButton id="createButton" icon="ui-icon-plus"   value="#{rentaBundle.Create}" actionListener="#{ingresosController.prepareCreate}" update=":IngresosCreateForm" oncomplete="IngresosCreateDialog.show()"/>
                        <p:commandButton id="viewButton"   icon="ui-icon-search" value="#{rentaBundle.View}" update=":IngresosViewForm" oncomplete="IngresosViewDialog.show()" disabled="#{empty ingresosController.selected}"/>
                        <p:commandButton id="editButton"   icon="ui-icon-pencil" value="#{rentaBundle.Edit}" update=":IngresosEditForm" oncomplete="IngresosEditDialog.show()" disabled="#{empty ingresosController.selected}"/>
                        <p:commandButton id="deleteButton" icon="ui-icon-trash"  value="#{rentaBundle.Delete}" actionListener="#{ingresosController.delete}" update=":growl,datalist" disabled="#{empty ingresosController.selected}"/>
                    </div>
                </f:facet>

            </p:dataTable>

        </p:panel>

    </h:form>

</ui:composition>